package org.qydjk.console.shiro;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.SessionListener;

public class ShiroSessionListener  implements SessionListener {
    private JedisShiroSessionRepository jedisShiroSessionRepository;

    public void onStart(Session session) {

    }

    public void onStop(Session session) {

    }

    public void onExpiration(Session session) {
        getJedisShiroSessionRepository().deleteSession(session.getId());
    }

    public JedisShiroSessionRepository getJedisShiroSessionRepository() {
        return jedisShiroSessionRepository;
    }

    public void setJedisShiroSessionRepository(JedisShiroSessionRepository jedisShiroSessionRepository) {
        this.jedisShiroSessionRepository = jedisShiroSessionRepository;
    }
}
